# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: jose <jose1711 [at] gmail (dot) com>

pkgname=gpsprune
pkgver=23
pkgrel=1
pkgdesc="View, edit and convert coordinate data from GPS systems"
arch=('any')
url="https://activityworkshop.net/software/gpsprune/"
license=('GPL')
depends=('hicolor-icon-theme' 'java-runtime')
makedepends=('imagemagick')
optdepends=('gnuplot: draw charts'
            'gpsbabel: load data directly from GPS receivers'
            'perl-image-exiftool: save coordinates into JPEG files')
source=("https://activityworkshop.net/software/$pkgname/${pkgname}_$pkgver.jar"
        "https://activityworkshop.net/software/gpsprune/prunelogo.png"
        "$pkgname.sh"
        "$pkgname.desktop"
        "$pkgname.appdata.xml")
noextract=("${pkgname}_$pkgver.jar")
sha256sums=('7117f6e3c5442a79301242196bd00ff04959a8965c1f8806789343a6a596197b'
            '9d08bebe643266d2be126597a6841b0364ab07b2d44fdde8c7ad2ec59088523c'
            'cd8b8f8fc54df03e7435e4849d734e7d9ef5291d8f75c6abab0bfe809fe6abd9'
            '744f83c1c6d76c3d339b41450ddc79a7c15fbaf6d637741fb2c09529a65a0311'
            'bba63de51deff95f3453bdacd8e34126c7cbbd33658fadad0b2c51b19855fdb9')

prepare() {
  convert prunelogo.png +set date:create +set date:modify -gravity center -extent 96x96 $pkgname.png
}

package() {
  install -Dm644 ${pkgname}_$pkgver.jar "$pkgdir/usr/share/java/$pkgname/$pkgname.jar"
  install -Dm755 $pkgname.sh "$pkgdir/usr/bin/$pkgname"
  install -Dm644 $pkgname.desktop "$pkgdir/usr/share/applications/$pkgname.desktop"
  install -Dm644 $pkgname.appdata.xml "$pkgdir/usr/share/metainfo/$pkgname.appdata.xml"
  install -Dm644 $pkgname.png "$pkgdir/usr/share/icons/hicolor/96x96/apps/$pkgname.png"
}
